/* 
 * File:   SimpleNumber.h
 * Author: Gab'z
 *
 * Created on 29 mai 2012, 12:25
 */

#ifndef SIMPLENUMBER_H
#define	SIMPLENUMBER_H

#include "Number.h"
#include "../../../exception/ArithmeticException.h"

namespace calculator {

    class SimpleNumber : public Number {
    public:
        virtual ~SimpleNumber();
        virtual std::string toString() const = 0;
        virtual SimpleNumber* clone() const = 0;
        virtual double value() const = 0;

        /**
         * Retourne la valeur du SimpleNumber
         * @return un double valant la valeur du nombre "simple".
         */
        operator double() const {
            return value();
        }

    protected:
        SimpleNumber();
    };

    SimpleNumber* add(const SimpleNumber* n1, const SimpleNumber* n2) throw (ArithmeticException);
    SimpleNumber* sub(const SimpleNumber* n1, const SimpleNumber* n2) throw (ArithmeticException);
    SimpleNumber* mul(const SimpleNumber* n1, const SimpleNumber* n2) throw (ArithmeticException);
    SimpleNumber* div(const SimpleNumber* n1, const SimpleNumber* n2) throw (ArithmeticException);
    SimpleNumber* pow(const SimpleNumber* n1, const SimpleNumber* n2) throw (ArithmeticException);

}

#endif	/* SIMPLENUMBER_H */

